import React, { Component } from 'react';
import { Image } from 'react-native';
import { createBottomTabNavigator, StackNavigator } from 'react-navigation';

import Home from './scene/Home';
import Mine from './scene/Mine';
import Cart from './scene/Cart';
import Category from './scene/Category';
import ItemDetail from './scene/ItemDetail';

const Tab = createBottomTabNavigator(
    {
      Home: {
        screen: Home,
        navigationOptions: ({ navigation }) => ({
          tabBarLabel: '首页',
        }),
      },
  
      Category: {
        screen: Category,
        navigationOptions: ({ navigation }) => ({
          tabBarLabel: '分类',
        }),
      },
  
      Cart: {
        screen: Cart,
        navigationOptions: ({ navigation }) => ({
          tabBarLabel: '购物车',
        }),
      },
  
  
      Mine: {
        screen: Mine,
        navigationOptions: ({ navigation }) => ({
          tabBarLabel: '我的',
        }),
      }
    },
  );

  const App = StackNavigator({

    TabPage: {
      screen: Tab,
    },
    ItemDetail:{
      screen:ItemDetail,
      navigationOptions: ({navigation}) => ({
         title: '详情',
      }),
    },
  
  }, {
    initialRouteName: 'TabPage',
    navigationOptions: {
      title: '水果商场',
      header: null,
    },
  });
  
  export default App;